var refound = {
	orderId:"",
	orderNum:""
};




			
mui(".save_btn")[0].addEventListener("tap",function(){
	
	
	var options = {
		orderNum : refound.orderNum,
		userId : Feng.userId,
		refundsReason : $("#refundsReason").val()
	};
	
	if(options.refundsReason===""){
		Feng.error("请输入退款原因");
		return;
	}
	
	var ajax = new $ax(Feng.ctxPath+"/refunds/refunds", function(data){        
        if (data.success){
		    layer.confirm('您的退款订单已提交成功，我们会在三个工作日内与你联系并处理', {
				btn: ['确定'] //按钮
			},function(){
				window.location.href="my-order.html";
			}); 
    
       
        }
    },function(data){
        Feng.error("查询详情失败!");
    });
    ajax.set(options);
    ajax.start();

});



$(function(){
	var args = getQueryStringArgs();
	refound.orderId = args["orderId"];
	
	var ajax = new $ax(Feng.ctxPath+"/order/getById", function(data){
        Feng.log("查询详情成功");
        if (data.success){
			 //图片过滤器
			var outHtml = template("detailTmpl",data.obj);			
			$("#frmMain .mui-input-row").before(outHtml);
			
			refound.orderNum = data.obj.orderNum; 
			
        }
    },function(data){
        Feng.error("查询详情失败!");
    });
    ajax.set("id",refound.orderId);
    ajax.start();
});